<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:s="http://jboss.org/schema/seam/taglib"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:rich="http://richfaces.org/rich"
  template="/WEB-INF/facelets/email/template_email.xhtml">

  <ui:param name="toName" value="#{emailServiceImpl.toName}"/>
  <ui:param name="toEmailAddr" value="#{emailServiceImpl.toEmailAddr}"/>
  <ui:param name="replyToName" value="#{sendEmail.fromName}"/>
  <ui:param name="replyToEmail" value="#{sendEmail.replyEmail}"/>
  <ui:param name="subject"
    value="#{msgs.format('jsf.email.rolerequest.Subject',
      sendEmail.fromLoginName, sendEmail.locale.localeId.id)}"/>

  <ui:define name="body">
    <p>#{msgs['jsf.email.coordinator.DearCoordinator']}</p>

    <p>
      #{msgs.format('jsf.email.rolerequest.UserRequestingRole',
        sendEmail.fromName, sendEmail.fromLoginName,
        sendEmail.locale.localeId.id, sendEmail.locale.retrieveNativeName())}
      <ul>
        <s:fragment
          rendered="#{languageJoinUpdateRoleAction.requestAsTranslator and !languageJoinUpdateRoleAction.isTranslator()}">
          <li>
            #{msgs['jsf.Translator']}
          </li>
        </s:fragment>

        <s:fragment
          rendered="#{languageJoinUpdateRoleAction.requestAsReviewer and !languageJoinUpdateRoleAction.isReviewer()}">
          <li>
            #{msgs['jsf.Reviewer']}
          </li>
        </s:fragment>

        <s:fragment
          rendered="#{languageJoinUpdateRoleAction.requestAsCoordinator and !languageJoinUpdateRoleAction.isCoordinator()}">
          <li>
            #{msgs['jsf.Coordinator']}
          </li>
        </s:fragment>
      </ul>
    </p>

    <s:fragment rendered="#{not empty sendEmail.htmlMessage}">
      <p>#{msgs.format('jsf.email.UserMessageIntro', sendEmail.fromName)}</p>
      <hr/>
      <h:outputText value="#{sendEmail.htmlMessage}" escape="false"/>
      <hr/>
    </s:fragment>

    <p>#{msgs.format('jsf.email.rolerequest.AddUserInstructions',
      sendEmail.fromName, sendEmail.locale.localeId.id)}</p>

    <p>#{msgs.format('jsf.email.coordinator.ResponseInstructions',
      sendEmail.locale.localeId.id, sendEmail.fromName, sendEmail.replyEmail)}</p>

    <p>
      <a
        href="#{applicationConfiguration.serverPath}/language/view/#{sendEmail.locale.localeId.id}">
        #{applicationConfiguration.serverPath}/language/view/#{sendEmail.locale.localeId.id}
      </a>
    </p>
  </ui:define>

</ui:composition>
